package com.example.demo.poi;

import org.apache.poi.hpsf.SummaryInformation;
import org.apache.poi.hwpf.HWPFDocument;
import org.apache.poi.ooxml.POIXMLDocument;
import org.apache.poi.ooxml.extractor.POIXMLTextExtractor;
import org.apache.poi.xssf.extractor.XSSFExcelExtractor;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
import org.apache.poi.xwpf.usermodel.XWPFDocument;

import java.io.*;

public class DoctUtil {

    public static void main(String[] args) throws IOException {
        InputStream inputStream = new FileInputStream(new File("D:\\workspacee\\杰橙云连锁后台管理\\相关表结构.doc"));
        /*XWPFDocument xwpfDocument = new XWPFDocument(inputStream);
        XWPFWordExtractor xwpfWordExtractor = new XWPFWordExtractor(xwpfDocument);
        String text = xwpfWordExtractor.getText();
        System.out.println(text);*/

        HWPFDocument hwpfDocument = new HWPFDocument(inputStream);
        String documentText = hwpfDocument.getDocumentText();
        System.out.println(documentText);
    }
}
